/*
 * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#pragma once

#ifdef __cplusplus
extern "C"
{
#endif

#define MAX_HTTP_OUTPUT_BUFFER              2048

/**
 * @brief Perform an HTTP POST request to search face info
 *
 * This function performs an HTTP POST request to the Baidu AI platform to search for a face match.
 * It first gets an access token, then converts the JPEG frame to base64, and sends the base64 data in the POST request.
 * The response from the server is parsed to determine if a face match was found.
 *
 * @param user_id A pointer to a string where the user ID of the matched face will be stored
 * @param frame_buffer A pointer to the buffer containing the JPEG frame
 * @param frame_length The length of the JPEG frame
 * @return true if a face match was found, false otherwise
 */
bool http_face_match(char *user_id, uint8_t *frame_buffer, size_t frame_length);

#ifdef __cplusplus
} /* end of extern "C" */
#endif